package sfmc.biz.daoImpl;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.stereotype.Repository;

import sfmc.biz.dao.SfmcMainDao;
import sfmc.biz.vo.Sfmc_TB_MAIN;

@Repository("SfmcMainDao")
public class SfmcMainDaoImpl implements SfmcMainDao{
	protected Log log = LogFactory.getLog(this.getClass());
	
	@Autowired
	private SqlMapClientTemplate sqlMapClientTemplate;
	   
	public List<Sfmc_TB_MAIN> getMainList(Sfmc_TB_MAIN dto) {
		return sqlMapClientTemplate.queryForList("getMainList",dto);
	}

	@Override
	public int getRecordCodunt(Sfmc_TB_MAIN dto) {
		return Integer.parseInt(""+sqlMapClientTemplate.queryForObject("getRecordCount",dto));
	}
	
	public int updateMain(Sfmc_TB_MAIN dto) {
		return sqlMapClientTemplate.update("updateMain", dto);
	}

	public int deleteMain(String dto) {
		return sqlMapClientTemplate.delete("deleteMain", dto);
	}
}
